public class Application {
    public static void main(String[] args) {
        Simulator simulator = new Simulator(); 
        simulator.playSound(new Dog()); 
        simulator.playSound(new Cat()); 
    }
}

abstract class Animal {
    abstract void cry();
    abstract String getAnimalName();
}

class Dog extends Animal {
    void cry() {
        System.out.println("汪汪汪");
    }

    String getAnimalName() {
        return "狗";
    }
}

class Cat extends Animal {
    void cry() {
        System.out.println("喵喵喵");
    }

    String getAnimalName() {
        return "猫";
    }
}

class Simulator {
    void playSound(Animal animal) {
        System.out.print(animal.getAnimalName() + " 的叫声是：");
        animal.cry(); 
    }
}